<!DOCTYPE html>
<html lang="zh">

<head>
    <title></title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script src="https://cdn.staticfile.net/vue/2.7.8/vue.js"></script>
    <link href="../css/style.css" rel="stylesheet">
</head>

<body>
<div id="app">
    <nba-all-stars c="奥尼尔" pf="加内特">
        <span slot="sf">皮尔斯</span>
        <span slot="sg">雷阿伦</span>
        <span slot="pg">隆多</span>
    </nba-all-stars>
</div>
<script>
    Vue.component('nba-all-stars', {
        props: ['c', 'pf'],
        template: `
          <div>
          <div>中峰：{{ c }}</div>
          <div>大前：{{ pf }}</div>
          <div>小前：
            <slot name="sf"></slot>
          </div>
          <div>分卫：
            <slot name="sg"></slot>
          </div>
          <div>控卫：
            <slot name="pg"></slot>
          </div>
          </div>
        `
    })
    const vm = new Vue({
        el: '#app'
    });
</script>
</body>
</html>